import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsNotEmpty, IsString } from 'class-validator';

export class UpdateOrderDto {
  @ApiProperty({ description: '用户ID' })
  userId?: number;

  @ApiProperty({ description: '餐厅ID' })
  restaurantId?: number;

  @ApiProperty({
    description: '订单状态：0-未支付，1-已支付，2-正在制作，3-已上菜',
  })
  status?: string;

  @ApiProperty({ description: '订单备注' })
  remark?: string;

  @ApiProperty({ description: '订单总金额' })
  totalAmount?: number;

  @ApiPropertyOptional({ description: '订单菜品列表' })
  @IsNotEmpty({ message: '订单菜品列表不能为空' })
  @IsString({ message: '订单菜品列表必须是字符串' })
  dishList?: string;
}
